package com.example.expresscabinet.controller;

import com.example.expresscabinet.common.Result;
import com.example.expresscabinet.model.sendexpress;
import com.example.expresscabinet.service.IPostageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/postage")
public class postageController {

    @Autowired
    IPostageService postageService;


    //用户寄件操作
    @GetMapping("/queryPostage/{fromWhere}/{toWhere}/{company}")
    public Result<?> queryPostage(@PathVariable String fromWhere,
                                  @PathVariable String toWhere,
                                  @PathVariable String company){
        int res=postageService.queryPostage(fromWhere,toWhere,company);
        return Result.success(res);
    }
}
